﻿<window:MetroDPIWindow x:Class="CircuitDiagram.winToolbox"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:my="clr-namespace:CircuitDiagram"
        xmlns:window="clr-namespace:CircuitDiagram.DPIWindow;assembly=CircuitDiagram.DPIWindow"
        Title="Customise Toolbox" Height="494" Width="784" ShowInTaskbar="False" WindowStartupLocation="CenterOwner" ResizeMode="NoResize"
        TitleCaps="False" WindowTransitionsEnabled="False" EnableDWMDropShadow="True">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/VS/Colors.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/VS/Styles.xaml" />
            </ResourceDictionary.MergedDictionaries>
            <BooleanToVisibilityConverter x:Key="BoolToVisConverter" />
            <my:KeyTextConverter x:Key="KeyTextConverter" />
            <my:MultiResolutionImageToImageSourceConverter x:Key="MultiResolutionImageToImageSourceConverter" />
            <DataTemplate x:Key="CategoryItemTemplate">
                <StackPanel Orientation="Horizontal">
                    <StackPanel.ToolTip>
                        <ToolTip>
                            <StackPanel Orientation="Vertical">
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock>Component:</TextBlock>
                                    <TextBlock Text="{Binding Description.ComponentName}" Margin="5,0,0,0" />
                                </StackPanel>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock>Author:</TextBlock>
                                    <TextBlock Text="{Binding Description.Metadata.Author}" Margin="5,0,0,0" />
                                </StackPanel>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock>Type:</TextBlock>
                                    <TextBlock Text="{Binding Description.Metadata.Type}" Margin="5,0,0,0" />
                                </StackPanel>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock>GUID:</TextBlock>
                                    <TextBlock Text="{Binding Description.Metadata.GUID}" Margin="5,0,0,0" />
                                </StackPanel>
                            </StackPanel>
                        </ToolTip>
                    </StackPanel.ToolTip>
                    <Rectangle Fill="White" Width="32" Height="32">
                        <Rectangle.OpacityMask>
                            <ImageBrush ImageSource="{Binding Path=Icon, Converter={StaticResource MultiResolutionImageToImageSourceConverter}}" Stretch="None" />
                        </Rectangle.OpacityMask>
                    </Rectangle>
                    <TextBlock Text="{Binding Description.ComponentName}" VerticalAlignment="Center" Margin="5,0,0,0" Visibility="{Binding Converter={StaticResource BoolToVisConverter}, Path=NoConfiguration}" />
                    <TextBlock Text="{Binding Configuration.Name}" VerticalAlignment="Center" Margin="5,0,0,0" Visibility="{Binding Converter={StaticResource BoolToVisConverter}, Path=HasConfiguration}" />
                </StackPanel>
            </DataTemplate>
        </ResourceDictionary>
    </Window.Resources>
    <Grid>
        <ListBox HorizontalAlignment="Left" Margin="12,46,0,41" Name="lbxCategories" Width="124">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding Name}" />
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
        <Button Content="Cancel" Height="23" HorizontalAlignment="Right" Margin="0,0,12,12" Name="btnCancel" VerticalAlignment="Bottom" Width="75" Click="btnCancel_Click" />
        <ListBox HorizontalAlignment="Left" Margin="142,46,0,41" Name="lbxItems" Width="182" ItemsSource="{Binding ElementName=lbxCategories, Path=SelectedItem.Items}" ItemTemplate="{StaticResource CategoryItemTemplate}" />
        <Label Content="Categories" Height="28" HorizontalAlignment="Left" Margin="12,12,0,0" Name="label1" VerticalAlignment="Top" />
        <Label Content="Items" Height="28" HorizontalAlignment="Left" Margin="142,12,0,0" Name="label2" VerticalAlignment="Top" />
        <ListBox Margin="482,75,12,41" Name="lbxAvailableItems" ItemTemplate="{StaticResource CategoryItemTemplate}" />
        <Label Content="Available Items" Height="28" HorizontalAlignment="Left" Margin="482,12,0,0" VerticalAlignment="Top" />
        <Button Content="&lt;&lt; Add" Height="23" HorizontalAlignment="Left" Margin="330,216,0,0" Name="btnAddItem" VerticalAlignment="Top" Width="146" Click="btnAddItem_Click" />
        <Button Content="Remove &gt;&gt;" Height="23" HorizontalAlignment="Left" Margin="330,245,0,0" Name="btnRemoveItem" VerticalAlignment="Top" Width="146" Click="btnRemoveItem_Click" />
        <Button Content="New Category" Height="23" HorizontalAlignment="Left" Margin="330,75,0,0" Name="btnNewCategory" VerticalAlignment="Top" Width="146" Click="btnNewCategory_Click" />
        <Button Content="Delete Category" Height="23" HorizontalAlignment="Left" Margin="330,104,0,0" Name="button5" VerticalAlignment="Top" Width="146" Click="button5_Click" />
        <Button Content="Category Up" Height="23" HorizontalAlignment="Left" Margin="330,133,0,0" Name="btnCategoryUp" VerticalAlignment="Top" Width="146" Click="btnCategoryUp_Click" />
        <Button Content="Category Down" Height="23" HorizontalAlignment="Left" Margin="330,162,0,0" Name="btnCategoryDown" VerticalAlignment="Top" Width="146" Click="btnCategoryDown_Click" />
        <Button Content="OK" Height="23" HorizontalAlignment="Right" Margin="0,0,93,12" Name="btnOK" VerticalAlignment="Bottom" Width="75" Click="btnOK_Click" />
        <Button Content="Item Up" Height="23" HorizontalAlignment="Left" Margin="330,274,0,0" Name="btnItemMoveUp" VerticalAlignment="Top" Width="146" Click="btnItemMoveUp_Click" />
        <Button Content="Item Down" Height="23" HorizontalAlignment="Left" Margin="330,303,0,0" Name="btnItemMoveDown" VerticalAlignment="Top" Width="146" Click="btnItemMoveDown_Click" />
        <Label Content="Shortcut key" Height="28" HorizontalAlignment="Left" Margin="142,0,0,8" Name="label3" VerticalAlignment="Bottom" />
        <TextBox Height="23" HorizontalAlignment="Left" Margin="271,0,0,11" Name="tbxShortcutKey" VerticalAlignment="Bottom" Width="53" MaxLength="1" Text="{Binding ElementName=lbxItems, Path=SelectedItem.ShortcutKey, Mode=TwoWay, Converter={StaticResource KeyTextConverter}}" />
        <TextBox Height="23" Margin="524,46,12,0" Name="tbxAvailableFilter" VerticalAlignment="Top" TextChanged="tbxAvailableFilter_TextChanged" />
        <Label Content="Filter" Height="28" HorizontalAlignment="Left" Margin="482,44,0,0" Name="label4" VerticalAlignment="Top" />
    </Grid>
</window:MetroDPIWindow>
